package com.beaven.model.model.card;

import com.beaven.model.model.db.Group;
import com.beaven.model.model.db.GroupMember;
import com.beaven.model.model.db.User;
import java.util.Date;

/**
 * author: Beaven
 * time: 2017/5/18 15:31
 */

public class GroupMemberCard {

  private String id;

  private String alias;

  private boolean isOwner;

  private String userId;

  private String groupId;

  private Date modifyAt;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getAlias() {
    return alias;
  }

  public void setAlias(String alias) {
    this.alias = alias;
  }

  public boolean isOwner() {
    return isOwner;
  }

  public void setOwner(boolean owner) {
    isOwner = owner;
  }

  public String getUserId() {
    return userId;
  }

  public void setUserId(String userId) {
    this.userId = userId;
  }

  public String getGroupId() {
    return groupId;
  }

  public void setGroupId(String groupId) {
    this.groupId = groupId;
  }

  public Date getModifyAt() {
    return modifyAt;
  }

  public void setModifyAt(Date modifyAt) {
    this.modifyAt = modifyAt;
  }

  public GroupMember build(Group group, User user) {
    GroupMember member = new GroupMember();
    member.setId(this.id);
    member.setAlias(this.alias);
    member.setOwner(this.isOwner);
    member.setModifyAt(this.modifyAt);
    member.setGroup(group);
    member.setUser(user);
    return member;
  }
}
